package cn.tedu.tourism.city.controller;

import cn.tedu.tourism.base.response.JsonResult;
import cn.tedu.tourism.city.pojo.dto.CityQuery;
import cn.tedu.tourism.city.service.CityService;
import cn.tedu.tourism.city.pojo.vo.CityVO;
import cn.tedu.tourism.province.pojo.entity.Province;
import cn.tedu.tourism.province.pojo.vo.ProvinceVO;
import cn.tedu.tourism.province.service.ProvinceService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/city")
@Api("城市模块")
public class CityController {
    @Autowired
    private CityService cityService;
    @GetMapping("/select")
    public JsonResult selectCity(CityQuery cityQuery){
        log.debug("城市参数为：{}",cityQuery);
        List<CityVO> cityVOS = cityService.select(cityQuery);
        return JsonResult.ok(cityVOS);
    }
}
